import { ref, computed } from "vue";
import { defineStore } from "pinia";

export const useLayoutStore = defineStore("layout", () => {
  // 侧边栏展开状态
  const collapsed = ref(false);
  
  // 切换展开状态
  const collapsedToggle = (flag?: boolean) => {
    collapsed.value = flag === undefined ? !collapsed.value : flag;
  }

  return { 
    collapsed, 
    collapsedToggle 
  };
});
